package com.hanbang.gycatering.myviews;
import com.hanbang.gycatering.application.MyApplication;
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.Button;

public class TypeFaceButton extends Button {
	public TypeFaceButton(Context context) {
		super(context);
	}

	public TypeFaceButton(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public TypeFaceButton(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	@Override
	public void setTypeface(Typeface tf, int style) {
		// ����application������غõ�����
		if (((MyApplication) getContext().getApplicationContext()).typeface != null) {
			super.setTypeface(((MyApplication) getContext()
					.getApplicationContext()).typeface, style);
		} else {
			super.setTypeface(tf, style);
		}
	}
}
